com.micromegacorp.math.v3_spi
Class Float32

java.lang.Object
  extended by com.micromegacorp.math.v3_spi.Float32

public class Float32
extends java.lang.Object


Field Summary
 int high
           
 int low
           
protected static java.lang.String notReset
           
protected static java.lang.StringBuffer sbuf
           
 
Constructor Summary
Float32()
          Create a new FpuData object initialized to zero.
Float32(Float32 fnum)
          Create a new Float32 initialized to the value of another Float32.
Float32(int num)
          Create a new Float32 initialized to the value of a 16-bit integer.
Float32(int high, int low)
          Create a new Float32 initialized to the floating point value contained in two 16-bit integers.
 
Method Summary
 Float32 add(Float32 fnum)
          Add another Float32 to this Float32.
 Float32 add(int num)
          Add a 16-bit integer value to this Float32.
 Float32 add(int high, int low)
          Add the floating point value contained in two 16-bit integers to this Float32.
 Float32 divide(Float32 fnum)
          Divide this Float32 by another Float32.
 Float32 divide(int num)
          Divide this floating point number by a 16-bit integer.
 Float32 divide(int high, int low)
          Divide this Float32 by the floating point value contained in two 16-bit integers.
protected  void loadA()
           
protected  void loadB(int high, int low)
           
protected  void loadC(int num)
           
 Float32 multiply(Float32 fnum)
          Multiply this Float32 by another Float32.
 Float32 multiply(int num)
          Multiply this Float32 by a 16-bit integer.
 Float32 multiply(int high, int low)
          Multiply this Float32 by the floating point value contained in two 16-bit integers.
 Float32 read()
          Read 32-bit floating point value from FPU register A.
 Float32 read(int reg)
          Read 32-bit floating point value from FPU register.
protected  Float32 saveA(int opcode)
           
 Float32 set(Float32 fnum)
          Set Float32 to the value of another Float32.
 Float32 set(int num)
          Set Float32 to the value of a 16-bit integer.
 Float32 set(int high, int low)
          Set Float32 to the floating point value contained in two 16-bit integers.
 Float32 set(java.lang.String s)
          Set Float32 to the floating point value represented by a String.
 Float32 set(java.lang.StringBuffer sb)
          Set Float32 to the floating point value represented by a StringBuffer.
 Float32 subtract(Float32 fnum)
          Subtract another Float32 from this Float32.
 Float32 subtract(int num)
          Subtract a 16-bit integer from this Float32.
 Float32 subtract(int high, int low)
          Subtract the floating point value contained in two 16-bit integers from this Float32.
protected  char toHex(int n)
           
 java.lang.String toHexString()
          Convert FpuData value to a hexadecimal string.
 java.lang.String toString()
          Convert value of this Float32 to a String.
 void write()
          Write 32-bit floating point value to the FPU register A.
 void write(int reg)
          Write 32-bit floating point value to the FPU register.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

high

public int high

low

public int low

notReset

protected static final java.lang.String notReset
See Also:
Constant Field Values

sbuf

protected static java.lang.StringBuffer sbuf
Constructor Detail

Float32

public Float32()
Create a new FpuData object initialized to zero.


Float32

public Float32(Float32 fnum)
Create a new Float32 initialized to the value of another Float32.

Parameters:
fnum - Float32 number.

Float32

public Float32(int high,
               int low)
Create a new Float32 initialized to the floating point value contained in two 16-bit integers.

Parameters:
high - high 16 bits of floating point value.
low - low 16 bits of floating point value.

Float32

public Float32(int num)
Create a new Float32 initialized to the value of a 16-bit integer.

Parameters:
num - 16-bit integer value (sign extended).
Method Detail

set

public Float32 set(Float32 fnum)
Set Float32 to the value of another Float32.

Parameters:
fnum - Float32 number.
Returns:
Float32 reference to result.

set

public Float32 set(int high,
                   int low)
Set Float32 to the floating point value contained in two 16-bit integers.

Parameters:
high - high 16 bits of floating point value.
low - low 16 bits of floating point value.
Returns:
Float32 reference to result.

set

public Float32 set(int num)
Set Float32 to the value of a 16-bit integer.

Parameters:
num - 16-bit integer value (sign extended).
Returns:
Float32 reference to result.

set

public Float32 set(java.lang.String s)
Set Float32 to the floating point value represented by a String.

Parameters:
s - String representing the floating point value.
Returns:
Float32 reference to result.

set

public Float32 set(java.lang.StringBuffer sb)
Set Float32 to the floating point value represented by a StringBuffer.

Parameters:
sb - StringBuffer representing the floating point value.
Returns:
Float32 reference to result.

add

public Float32 add(Float32 fnum)
Add another Float32 to this Float32.

Parameters:
fnum - Float32 to add.
Returns:
Float32 reference to result.

add

public Float32 add(int high,
                   int low)
Add the floating point value contained in two 16-bit integers to this Float32.

Parameters:
high - high 16 bits of floating point value to add.
low - low 16 bits of floating point value to add.
Returns:
Float32 reference to result.

add

public Float32 add(int num)
Add a 16-bit integer value to this Float32.

Parameters:
num - 16-bit integer value (sign extended) to add.
Returns:
Float32 reference to result.

subtract

public Float32 subtract(Float32 fnum)
Subtract another Float32 from this Float32.

Parameters:
fnum - Float32 to subtract.
Returns:
Float32 reference to result.

subtract

public Float32 subtract(int high,
                        int low)
Subtract the floating point value contained in two 16-bit integers from this Float32.

Parameters:
high - high 16 bits of floating point value to subtract.
low - low 16 bits of floating point value to subtract.
Returns:
Float32 reference to result.

subtract

public Float32 subtract(int num)
Subtract a 16-bit integer from this Float32.

Parameters:
num - 16-bit integer value (sign extended) to subtract.
Returns:
Float32 reference to result.

multiply

public Float32 multiply(Float32 fnum)
Multiply this Float32 by another Float32.

Parameters:
fnum - Float32 multiplier.
Returns:
Float32 reference to result.

multiply

public Float32 multiply(int high,
                        int low)
Multiply this Float32 by the floating point value contained in two 16-bit integers.

Parameters:
high - high 16 bits of floating point multiplier.
low - low 16 bits of floating point multiplier.
Returns:
Float32 reference to result.

multiply

public Float32 multiply(int num)
Multiply this Float32 by a 16-bit integer.

Parameters:
num - 16-bit integer (sign extended) multiplier.
Returns:
Float32 reference to result.

divide

public Float32 divide(Float32 fnum)
Divide this Float32 by another Float32.

Parameters:
fnum - Float32 divisor.
Returns:
Float32 reference to result.

divide

public Float32 divide(int high,
                      int low)
Divide this Float32 by the floating point value contained in two 16-bit integers.

Parameters:
high - high 16 bits of floating point divisor.
low - low 16 bits of floating point divisor.
Returns:
Float32 reference to result.

divide

public Float32 divide(int num)
Divide this floating point number by a 16-bit integer.

Parameters:
num - 16-bit integer divisor (sign extended).
Returns:
Float32 reference to result.

write

public void write()
Write 32-bit floating point value to the FPU register A.


write

public void write(int reg)
Write 32-bit floating point value to the FPU register. If reg = -1, then write to register A. If reg = -2, then write to register X.

Parameters:
reg - register value.

read

public Float32 read()
Read 32-bit floating point value from FPU register A.

Returns:
Float32 32-bit floating point value.

read

public Float32 read(int reg)
Read 32-bit floating point value from FPU register. If reg = -1, then read from register A. If reg = -2, then read from register X.

Parameters:
reg - register value.
Returns:
Float32 32-bit floating point value.

toString

public java.lang.String toString()
Convert value of this Float32 to a String.

Overrides:
toString in class java.lang.Object
Returns:
String representation of Float32.

toHexString

public java.lang.String toHexString()
Convert FpuData value to a hexadecimal string.

Returns:
text representation of FpuData value.

loadA

protected void loadA()

loadB

protected void loadB(int high,
                     int low)

loadC

protected void loadC(int num)

saveA

protected Float32 saveA(int opcode)

toHex

protected char toHex(int n)